home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / ident / patches / nntp-1.5.11.patch < prev    next >
Encoding:
Text File  |  1993-08-09  |  3.5 KB  |  144 lines

  1. ObIdent:
  2.   I've finally got a patch to add RFC931 (or whatever) support to
  3. News (or rather NNTP v1.5.11).  Again it's based on someone else's
  4. work (Nick Sayer - nsayer@uop.edu) but I've extended it somewhat.
  5. I'll append the patch.
  6.  
  7. Dave
  8. -------------------------------------------------------------------------------
  9. Dave Shield                  Janet: D.T.Shield@uk.ac.liverpool.compsci
  10. Dept. of Computer Science,          I'net: D.T.Shield@compsci.liverpool.ac.uk
  11. Liverpool University,        "I _order_ you to help!
  12. PO Box 147,             You're a machine and you must do
  13. Liverpool, L69 3BX         what you're told."    T. Pratchett, _Diggers_ 
  14.  
  15.  
  16.  
  17.  
  18. *** server/access.c.cln    Sat Feb  9 19:18:08 1991
  19. --- server/access.c    Wed May 26 12:51:39 1993
  20. ***************
  21. *** 46,51 ****
  22. --- 46,58 ----
  23.   extern    int Needauth;
  24.   #endif AUTH
  25.   
  26. + #ifdef RFC931
  27. + char username[32];
  28. + char *auth_tcpuser();
  29. + int auth_fd();
  30. + #endif
  31.   host_access(canread, canpost, canxfer, gdlist)
  32.       int        *canread, *canpost, *canxfer;
  33.       char        *gdlist;
  34. ***************
  35. *** 122,129 ****
  36. --- 129,160 ----
  37.           if (isupper(*cp))
  38.               *cp = tolower(*cp);
  39.   
  40. + #ifdef RFC931
  41. + {
  42. +   unsigned long in;
  43. +   unsigned short local;
  44. +   unsigned short remote;
  45. +   char *ruser;
  46. +   ruser=NULL;
  47. +   if (auth_fd(0,&in,&local,&remote) != -1)
  48. +     ruser = auth_tcpuser(in,local,remote);
  49. +   if (ruser == NULL)
  50. +     ruser = "[unauthenticated]";
  51. +   strcpy(username,ruser);
  52. + }
  53.   #ifdef LOG
  54. +     syslog(LOG_INFO, "%s connect (%s)\n", host_name,username);
  55. + #endif
  56. + #else
  57. + #ifdef LOG
  58.       syslog(LOG_INFO, "%s connect\n", host_name);
  59. + #endif
  60.   #endif
  61.       (void) strcpy(hostname, host_name);
  62.   
  63. *** server/common.h.cln    Sat Feb  2 21:55:37 1991
  64. --- server/common.h    Wed May 26 12:46:06 1993
  65. ***************
  66. *** 190,195 ****
  67. --- 190,199 ----
  68.   extern    char    hostname[];
  69.   extern    int    debug;
  70.   
  71. + #ifdef RFC931
  72. + extern        char    username[];
  73. + #endif
  74.   #ifdef LOG
  75.   extern    int    grps_acsd, arts_acsd;
  76.   
  77. *** server/post.c.cln    Sun Dec 23 17:50:02 1990
  78. --- server/post.c    Wed May 26 13:07:25 1993
  79. ***************
  80. *** 64,70 ****
  81. --- 64,75 ----
  82.       (void) fflush(stdout);
  83.   
  84.   #ifdef LOG
  85. + #ifdef RFC931
  86. +     syslog(LOG_INFO, "%s post %s (%s)", hostname,
  87. +             retcode == 1 ? "succeeded" : "failed", username);
  88. + #else
  89.       syslog(LOG_INFO, "%s post %s", hostname,
  90.               retcode == 1 ? "succeeded" : "failed");
  91. + #endif
  92.   #endif
  93.   }
  94. *** server/spawn.c.cln    Sat Feb  9 00:30:43 1991
  95. --- server/spawn.c    Wed May 26 12:50:42 1993
  96. ***************
  97. *** 92,97 ****
  98. --- 92,105 ----
  99.       if (cont_code == CONT_POST)
  100.           fprintf(fp, "Nntp-Posting-Host: %s\n", hostname);
  101.   #endif AUTH
  102. + #ifdef RFC931
  103. +     /*
  104. +     * If this is a posting, rather than an XFER, mention
  105. +     * who it really came from.
  106. +     */
  107. +     if (cont_code == CONT_POST)
  108. +         fprintf(fp, "Nntp-Posting-User: %s\n", username);
  109. + #endif RFC931
  110.   
  111.       printf("%d Ok\r\n", cont_code);
  112.       (void) fflush(stdout);
  113. *** common/conf.h.dist    Sat Feb  9 00:31:07 1991
  114. --- common/conf.h    Wed Jun  9 10:35:49 1993
  115. ***************
  116. *** 201,207 ****
  117. --- 201,216 ----
  118.   /* Things that relate to authentication and access */
  119.   /* Define AUTH to use the proposed NNTP Version 2 authentication protocol. */
  120.   #define    AUTH    
  121.   /*
  122. +  * Will we do RFC931 authentication?
  123. +  * If so, the makefiles for nntpd need to be fixed to add -lauthuser.
  124. +  * Currently RFC931 data is just logged. After all, it really can't
  125. +  * be trusted very far.
  126. +  */
  127. + #define RFC931
  128. + /*
  129.    * A file containing the name of the host which is running
  130.    * the news server.  This will have to match what rrn thinks,
  131.    * too.
  132.  
  133.